#include <stdio.h>
#include <stdlib.h>

void bubble_sort(int *arr, int length)
{
    int index = 0;
    while (index < length)
    {
        int innerIndex = 0;
        while (innerIndex < length)
        {
            if (arr[index] < arr[innerIndex])
            {
                int a = arr[index];
                int b = arr[innerIndex];
                a = a ^ b;
                b = a ^ b;
                a = a ^ b;
                arr[index] = a;
                arr[innerIndex] = b;
            }
            innerIndex++;
        }
        index++;
    }
}

int main(int argc, char const *argv[])
{
    int arr[] = {101, 89, 56, 32, 78, 95, 67, 76, 98, 29};
    int length = sizeof(arr) / sizeof(int);
    bubble_sort(arr, sizeof(arr) / sizeof(int));
    int index = 0;
    do
    {
        printf("%d\n", arr[index]);
        index++;
    } while (index < length);

    return 0;
}
